inst_len in HVM mmio handler must be a signed variable, as
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 21 Feb 2006 18:32:15 +0000 (19:32 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 21 Feb 2006 18:32:15 +0000 (19:32 +0100)
it may hold an error return value (from hvm_instruction_length).

Signed-off-by: Tom Woller <thomas.woller@amd.com>
xen/arch/x86/hvm/platform.c

index 4a2e0c851cb282dfd9dacf9dbde7e141afbf0ed4..ce944ea47ba4bb0548f38559962f546d0aca90fe 100644 (file)
@@ -760,12 +760,12 @@ static void mmio_operands(int type, unsigned long gpa, struct instruction *inst,
 
 void handle_mmio(unsigned long va, unsigned long gpa)
 {
-    unsigned long inst_len, inst_addr;
+    unsigned long inst_addr;
     struct mmio_op *mmio_opp;
     struct cpu_user_regs *regs;
     struct instruction mmio_inst;
     unsigned char inst[MAX_INST_LEN];
-    int i, realmode, ret;
+    int i, realmode, ret, inst_len;
     struct vcpu *v = current;
 
     mmio_opp = &v->arch.hvm_vcpu.mmio_op;
@@ -795,7 +795,7 @@ void handle_mmio(unsigned long va, unsigned long gpa)
 
     if (hvm_decode(realmode, inst, &mmio_inst) == DECODE_failure) {
         printf("handle_mmio: failed to decode instruction\n");
-        printf("mmio opcode: va 0x%lx, gpa 0x%lx, len %ld:",
+        printf("mmio opcode: va 0x%lx, gpa 0x%lx, len %d:",
                va, gpa, inst_len);
         for (i = 0; i < inst_len; i++)
             printf(" %02x", inst[i] & 0xFF);